//
//  YCJGViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/9/1.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "YCJGViewController.h"

@interface YCJGViewController ()
@property (weak, nonatomic) IBOutlet UILabel *labName;
@property (weak, nonatomic) IBOutlet UILabel *labMoney;

@end

@implementation YCJGViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self showNav:@"预测结果"];    //136000
    
    NSString *firstName = [_name substringToIndex:1];
    NSMutableArray *arr = [NSMutableArray array];
    for (int i = 0; i < _name.length-1; i ++) {
        [arr addObject:@"*"];
    }
    NSString *nameNew = [firstName stringByAppendingString:[arr componentsJoinedByString:@""]];
    _labName.text = [NSString stringWithFormat:@"%@的年薪约",nameNew];
    NSString *str1 = [_phone substringToIndex:2];
    NSString *str2 = [_phone substringFromIndex:9];
    NSString *str3 = [NSString stringWithFormat:@"%@%@00 元",str1,str2];
    
    _labMoney.text = str3;
    
}


//邀请朋友
- (IBAction)shareFriend:(id)sender {
    [SVProgressHUD show];
    NSString *url = [NSString stringWithFormat:@"%@/App/Annualsalary/sharing",urlHead];

    [[AFHTTPSessionManager manager]POST:url parameters:@{} success:^(NSURLSessionDataTask *task, id responseObject) {
        [SVProgressHUD dismiss];
        NSLog(@"苦力res:%@",responseObject);
        NSDictionary *dic = responseObject[@"result"];
        if (dic.count>0) {
            NSString *content = dic[@"content"];
            NSString *title   = dic[@"title"];
            NSString *url     = dic[@"url"];

        }

        NSLog(@"cheng gong");
        

    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [SVProgressHUD dismiss];
        NSLog(@"shi bai");

    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
